<template>
    <div>
      {{ num }}
      <button @click="num++">+1</button>
      <button @click="sub">-1</button>
    </div>
  </template>
  <script setup>
  import {ref} from 'vue'
  // 事件绑定
  
  let num = ref(10)
  
  const sub = () => {
    num.value--
  }
  </script>
  <style scoped>
  </style>